#ifndef STDFCONFIG_H
#define STDFCONFIG_H

#include <map>
#include <string>
#include <rectype.h>
#include <fstream>
#include <vector>

namespace opsrc {

    namespace stdf {

        using std::string;
        using std::map;
        using std::ifstream;
        using std::vector;

        class StdfConfig
        {
        public:
            static StdfConfig* instance();
            void setConfigFile(const string s);
            bool getRecSetting(stdf_rec rec) const;
            string getFilename() const;
            string getDestDir() const;
            string getSrcDir() const;
            void setFilename(const string& s);
            string getOutputMode() const {
                return sOutputMode;
            }
            bool getIsDebugSwitchSet() const;


            void setStdfFieldsSetting(vector<string> stdffields);
            void updateSetting(const string type, const string bval);
            void updateSetting(const string type, bool val);

            bool hasTestNumbers() const;
            vector<int> getTestNumbersSetting() const;  //call hasTestNumbers check before getting list
            void setTestNumbers(vector<int> list);
            void stdfFieldsRecSettingInitializeAs(bool flag);

        private:
            StdfConfig();
            static StdfConfig * inst;
            map< int, bool > stdf_fields_setting;
            ifstream ifile;
            string sDesDir;
            string sSrcDir;
            string sOutputMode;
            string sFileName;

            // commandline options
            vector<int> test_numbers_setting;
            bool debug;

        };

    }
}
#endif // STDFCONFIG_H
